Unsupervised Learning: Trade&Ahead

Marks: 60

Context

The stock market has consistently proven to be a good place to invest in and save for the future. There are a lot of compelling reasons to invest in stocks. It can help in fighting inflation, create wealth, and also provides some tax benefits. Good steady returns on investments over a long period of time can also grow a lot more than seems possible. Also, thanks to the power of compound interest, the earlier one starts investing, the larger the corpus one can have for retirement. Overall, investing in stocks can help meet life's financial aspirations.

It is important to maintain a diversified portfolio when investing in stocks in order to maximise earnings under any market condition. Having a diversified portfolio tends to yield higher returns and face lower risk by tempering potential losses when the market is down. It is often easy to get lost in a sea of financial metrics to analyze while determining the worth of a stock, and doing the same for a multitude of stocks to identify the right picks for an individual can be a tedious task. By doing a cluster analysis, one can identify stocks that exhibit similar characteristics and ones which exhibit minimum correlation. This will help investors better analyze stocks across different market segments and help protect against risks that could make the portfolio vulnerable to losses.

Objective

Trade&Ahead is a financial consultancy firm who provide their customers with personalized investment strategies. They have hired you as a Data Scientist and provided you with data comprising stock price and some financial indicators for a few companies listed under the New York Stock Exchange. They have assigned you the tasks of analyzing the data, grouping the stocks based on the attributes provided, and sharing insights about the characteristics of each group.

Data Dictionary

Importing necessary libraries and data

Data Overview

Exploratory Data Analysis (EDA)

Questions:

  1. What does the distribution of stock prices look like?
  2. The stocks of which economic sector have seen the maximum price increase on average?
  3. How are the different variables correlated with each other?
  4. Cash ratio provides a measure of a company's ability to cover its short-term obligations using only cash and cash equivalents. How does the average cash ratio vary across economic sectors?
  5. P/E ratios can help determine the relative value of a company's shares as they signify the amount of money an investor is willing to invest in a single share of a company per dollar of its earnings. How does the P/E ratio vary, on average, across economic sectors?

GICS Sub Industry

Numerical Columns

What does the distribution of stock prices look like?

Current price

Price change

Volatility

Cash Ratio / ROE

Net Income / EPS

Estimated shares outstanding

P/E and P/B Ratio

Conclusions

The stocks of which economic sector have seen the maximum price increase on average?

How are the different variables correlated with each other?

Cash ratio provides a measure of a company's ability to cover its short-term obligations using only cash and cash equivalents. How does the average cash ratio vary across economic sectors?

P/E ratios can help determine the relative value of a company's shares as they signify the amount of money an investor is willing to invest in a single share of a company per dollar of its earnings. How does the P/E ratio vary, on average, across economic sectors?

Data Preprocessing

K-means Clustering

Cluster Profiling

KMeans Clusters

Cluster 0 - Large Market Capitalization / Dow Jones Industrial Average

Cluster 1 - "Cash is King"

Cluster 2 - S&P 500 / Diversification

Cluster 3 - "Ride the Energy Rollercoaster" portfolio / Growth mindset

Cluster 4 - High Earnings for a High Price

Hierarchical Clustering

Cluster Profiling

In contrasts, the dendrogram for Ward linkage appears to provide better clustering, with 5 appearing to be the appropriate number of clusters

Cluster Profiling

Hierarchical Clusters

Cluster 0 - Growth for a Price

Cluster 1 - Short-term Poor, Long-term Rich

Cluster 2- DJIA

Cluster 3 - Diversification

Cluster 4 - Energy-specific portfolio

K-means vs Hierarchical Clustering

You compare several things, like: Which clustering technique took less time for execution?

Which clustering technique gave you more distinct clusters, or are they the same? How many observations are there in the similar clusters of both algorithms?

How many clusters are obtained as the appropriate number of clusters from both algorithms?

You can also mention any differences or similarities you obtained in the cluster profiles from both the clustering techniques.

Differences or similarities in the cluster profiles from both the clustering techniques

Actionable Insights and Recommendations

Based on the analysis conducted by Trade&Ahead, the following actionable insights and recommendations can be made:

  1. Identify Client's Financial Goals and Risk Tolerance: Before recommending any specific portfolio, Trade&Ahead should thoroughly understand the financial goals and risk tolerance of their clients. This will enable them to tailor their recommendations according to individual client needs.

  2. Recommend Clusters as Potential Portfolios: Once the client's financial goals and risk tolerance have been identified, Trade&Ahead can recommend clusters of stocks that align with these requirements. These clusters should consist of stocks that have similar characteristics and exhibit patterns that match the client's investment behaviors.

  3. Consider Standard Indexes as Alternatives: While recommending clusters is one approach, Trade&Ahead should also consider the possibility that many of these clusters essentially act as substitutes for standard indexes like the Dow Jones Industrial Average and the S&P 500. In cases where these standard indexes can more easily achieve the client's goals, Trade&Ahead may advise investing in index funds or ETFs rather than creating a custom cluster.

  4. Perform Financial Statement Analysis: Instead of relying solely on the recommended clusters, Trade&Ahead can utilize them as a starting point for further analysis. Specifically, they can conduct a thorough financial statement analysis of the individual stocks within each cluster.

  5. Identify Outliers and Deviations: During the financial statement analysis, Trade&Ahead should pay close attention to stocks that do not fit the profile of the cluster or exhibit significant deviations from the expected patterns. These stocks may present opportunities or risks that can impact the overall performance of the portfolio.

  6. Recommend Individual Stocks: If selecting individual stocks aligns with the client's investment strategy, Trade&Ahead can leverage the insights gained from financial statement analysis to identify specific stocks that are likely to outperform their peers or underperform them.

  7. Buy or Sell Recommendations: Based on the identified stocks' characteristics and expected performance, Trade&Ahead can provide buy or sell recommendations to their clients. These recommendations should be aligned with the client's financial goals, risk tolerance, and the analysis conducted on individual stocks.

By following these recommendations, Trade&Ahead can provide personalized investment advice to their clients while considering both the cluster-based approach and the unique characteristics of individual stocks. This approach will help clients achieve their financial goals while managing risk effectively.